home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Build beacon path information for certain ports *)
- (* *)
- (* Copyright 1991 by H. Roy Engehausen. All rights reserved. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* Build beacon ports *)
- (*===========================================================================*)
-
- PROCEDURE build_beacon_ports;
-
- {$I AX25.PAS}
-
- VAR
- this_port : port_block_ptr;
-
- (*=========================================================================*)
- (* This routine is change a call sign to AX25 format *)
- (*=========================================================================*)
-
- PROCEDURE call_change_to_packet(VAR out_call : address_field;
- in_call : STRING);
-
- VAR
- char_temp : CHAR;
- i : INTEGER;
- j : INTEGER;
- out_temp : address_field;
- ssid_temp : BYTE;
- ssid_switch : BOOLEAN;
-
- LABEL iterate;
-
- BEGIN;
-
- (*-------------------------------------------------------------------*)
- (* Blank it out to start with *)
- (*-------------------------------------------------------------------*)
-
- out_temp.name[1] := CHR(0);
-
- FOR i := 2 TO 6 DO
- out_temp.name[i] := CHR(ORD(' ') * 2);
-
- out_temp.addr_flag := flag_reser;
-
- out_call := out_temp;
-
- j := LENGTH(in_call);
-
- IF (j = 0) OR (in_call[1] = ' ') THEN
- EXIT;
-
- WHILE (j > 1) AND (in_call[j] = ' ') DO
- j := j - 1;
-
- i := 0;
- ssid_switch := FALSE;
- ssid_temp := 0;
-
- WHILE i < j DO
- BEGIN;
-
- i := i + 1;
-
- char_temp := UPCASE(in_call[i]);
-
- IF char_temp = '-' THEN
- BEGIN;
- IF ssid_switch THEN
- EXIT;
-
- ssid_switch := TRUE;
- GOTO ITERATE;
- END;
-
- IF ssid_switch THEN
- BEGIN;
- IF (char_temp < '0') OR (char_temp > '9') THEN
- EXIT;
- ssid_temp := 10 * ssid_temp + (ORD(char_temp) - ORD('0'));
- GOTO ITERATE;
- END;
-
- IF i <= 6 THEN
- out_temp.name[i] := CHR(ORD(char_temp) * 2)
- ELSE
- EXIT;
-
- iterate:
-
- END;
-
- IF ssid_temp > ssid_max THEN
- EXIT;
-
- out_temp.addr_flag := ((ssid_temp SHL flag_ssid_shift) AND flag_ssid);
-
- out_call := out_temp;
-
- END;
-
- (*=========================================================================*)
- (* Build the BPQ path *)
- (*=========================================================================*)
-
- PROCEDURE build_bpq_path;
-
- VAR
- info : address_area;
- buff : ARRAY[1..256] OF BYTE;
-
- i : BYTE;
- p : STRING;
- w : STRING[10];
-
- BEGIN;
-
- p := this_port^.bcst_path;
-
- w := subword(@p, 1, 1);
-
- call_change_to_packet(info.dest, w);
-
- call_change_to_packet(info.source, opt_block.this_bb_addr);
-
- i := 2 * SIZEOF(address_field);
-
- MOVE(info, buff[1], i);
-
- buff[i] := control_uf;
- buff[i+1] := protocol_no3;
-
- END;
-
- BEGIN;
-
- this_port := port_chain;
- WHILE this_port <> NIL DO
- BEGIN;
-
- CASE this_port^.port_type OF
- port_bpqhost:
- IF this_port^.bcst_path <> '' THEN
- build_bpq_path;
- ELSE
- ;
- END;
-
- this_port := this_port^.next_port;
- END;
-
- END;